<?php
/**
 * Created by PhpStorm
 * User: Jhinwy
 * Date: 5/31/24
 * Time: 2:49 PM
 */

namespace app\adminapi\controller\risk_report;


use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\risk_report\ReportLists;
use app\adminapi\logic\risk_report\ReportLogic;

/**
 * Report控制器
 *
 * Class OrderController
 * @package app\adminapi\controller
 */
class ReportController extends BaseAdminController
{

    /**
     * @notes 风控报表
     *
     * @return \think\response\Json
     * @author likeadmin
     * @date 2024/02/01 10:45
     */
    public function lists()
    {
        return $this->dataLists(new ReportLists());
    }


    /**
     * 获取小时报表
     *
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getHourReport()
    {
        $promotionLinkId = $this->request->get('promotion_link_id', 0);
        $date            = $this->request->get('date', '');
        $charge          = $this->request->get('charge', 100);

        return $this->data((new ReportLogic())->getHourReport($promotionLinkId, $date, $charge));

    }
}
